using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Xml;
using System.Web;
using DotNetNuke;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Services.Search;

namespace PT.ThueXe
{
    public class ThueXeController
    {

        #region Constructors

        public ThueXeController()
        {
        }

        #endregion

        #region Public Methods

        public void DeleteThueXe(int ModuleId, int ItemId)
        {
            DataProvider.Instance().DeleteThueXe(ModuleId, ItemId);
        }

        public ThueXeInfo GetThueXe(int ModuleId, int ItemId)
        {
            return CBO.FillObject<ThueXeInfo>(DataProvider.Instance().GetThueXe(ModuleId, ItemId));
        }

        public List<ThueXeInfo> GetThueXes(string Name, int CarTypeID, int FromCityID, int ToCityID, DateTime? FromDate, DateTime? ToDate, DateTime? CreatedDate)
        {
            return CBO.FillCollection<ThueXeInfo>(DataProvider.Instance().GetThueXes(Name, CarTypeID, FromCityID, ToCityID, FromDate, ToDate, CreatedDate));
        }

        public void AddUpdateThueXe(ThueXeInfo objThueXe)
        {
            DataProvider.Instance().AddUpdateThueXe(objThueXe.ModuleId, objThueXe.ItemId, objThueXe.Name, objThueXe.Address, objThueXe.Phone, objThueXe.Email, objThueXe.CarTypeID, objThueXe.FromCityID, objThueXe.ToCityID, objThueXe.FromDate, objThueXe.ToDate, objThueXe.OtherInformation, objThueXe.DetailInformation, objThueXe.CreatedDate);
        }

        public List<CarTypeInfo> GetCarTypeList()
        {
            return CBO.FillCollection<CarTypeInfo>(DataProvider.Instance().GetCarTypeList());
        }

        public List<CityInfo> GetCityList()
        {
            return CBO.FillCollection<CityInfo>(DataProvider.Instance().GetCityList());
        }

        public ThueXeEmail GetThueXeEmail()
        {
            return CBO.FillObject<ThueXeEmail>(DataProvider.Instance().GetThueXeEmail());
        }
        public void AddUpdateThueXeEmail(string MailFrom, string MailTo)
        {
            DataProvider.Instance().AddUpdateThueXeEmail(MailFrom, MailTo);
        }
        #endregion
    }
}

